package com.jmd.ui.tab.a_mapview.panel.top_tool_panel;

import com.jmd.ui.tab.a_mapview.panel.top_tool_panel.sub.MapControlButtonPanel;
import com.jmd.ui.tab.a_mapview.panel.top_tool_panel.sub.DistrictSelectorPanel;
import com.jmd.ui.tab.a_mapview.panel.top_tool_panel.sub.StatusPanel;
import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.swing.*;
import java.awt.*;
import java.io.Serial;

@Component
public class TopToolPanel extends JPanel {

	@Serial
	private static final long serialVersionUID = 3809138500637764353L;

	@Autowired
	private MapControlButtonPanel mapControlButtonPanel;
	@Autowired
	private DistrictSelectorPanel districtSelectorPanel;
	@Autowired
	private StatusPanel statusPanel;

	@PostConstruct
	private void init() {

		this.setLayout(new BorderLayout(0, 0));

		var left = new JPanel();
		left.setLayout(new BorderLayout());

		left.add(mapControlButtonPanel, BorderLayout.WEST);
		left.add(districtSelectorPanel, BorderLayout.EAST);

		this.add(left, BorderLayout.WEST);
		this.add(statusPanel, BorderLayout.CENTER);

	}

}
